<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><{$Think.config.cfg_webname}></title>
    <link href="__CSS__/base.css" rel="stylesheet">
    <link rel="stylesheet" href="__PUBLIC__/custom/uimaker/easyui.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/custom/uimaker/icon.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/fonts/iconfont.css">
    <script type="text/javascript" src="__PUBLIC__/custom/jquery.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/custom/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/custom/easyui-lang-zh_CN.js"></script>
    <style>
        #form{ padding: 10px;}
        .formTable td{border-bottom: 1px dashed #efefef; height: 40px;}
        .td-left{ text-align: right; padding-right: 10px;}
        .formTable .cnote {
            margin-left: 20px;
            color: #bfbfbf;
        }
        .formTable .trace {
            margin-left: 20px;
            color: red;
        }
        .logo_wrap{
            position: relative;
            width: 134px;
            height: 134px;
            margin: 5px;
        }
        .icon{
            width: 30px;
            height: 30px;
            font-size: 20px;
            vertical-align: middle;
            text-align: right;
            color:#333;
            -webkit-transition: font-size 0.25s ease-out 0s;
            -moz-transition: font-size 0.25s ease-out 0s;
            transition: font-size 0.25s ease-out 0s;
            position: absolute;
            right: -30px;
            top:0px;
            cursor: pointer;
            font-weight: 700;
        }
        .icon:hover{
            font-size: 30px;
        }


        .picarr{width:643px;min-height:100px;padding:0 12px 8px;margin-bottom:7px;border:1px solid #ccc;_height:auto!important;_height:100px;}
        .picarr legend{padding:3px 8px;font-weight:bold;color:#666;}
        .picarr div{width:190px;line-height:76px;color:#999;margin:0 auto;}
        .picarr div span{margin-left:8px;font-weight:bold;color:#09f;cursor:pointer;}
        .picarr div strong{padding:0 3px;color:#d30000;}
        .picarr ul li{float:left;width:311px;padding:0 0 8px 10px;}
        .picarr ul li input{height:22px;line-height:22px;text-indent:3px;border:none;border-bottom:1px solid #ccc;width:80%;!float:left!important;_float:left; font-size:12px;}
        .picarr ul li a{margin-left:15px;color:#09F;}
        .picarr ul li span{margin-left:15px;}

    </style>
</head>
<body>
<div class="easyui-panel" title="修改单页信息" style="width:100%;" data-options="footer:'#add_ft',fit:true">
<form name="form" id="form" method="post" action="<{:U('School/insert')}>">
    <input type="hidden" value="" name="id" />
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="formTable">

        <tr>
            <td class="td-left">栏目名称：</td>
            <td>
                <input name="topic" type="text" class="easyui-textbox" data-options="" style="height:30px;width:200px;"  value = "<{$row['classname']}>"disabled/>
            </td>
        </tr>
        <tr>
            <td class="td-left">栏目内容：</td>
            <td><input name="content" class="easyui-textbox" type="text" data-options="multiline:true"  value = "<{$row['content']}>" style="height:300px; width:600px;" /></td>
        </tr>
        <tr>
            <td class="td-left">上传缩略图：</td>
            <td>
                <input type="text" name="picurl" id="picurl" class="input" style="height:30px; width:300px;" value="<{$row['content']}>"  />
                <span class="cnote"><span class="grayBtn" onclick="GetUploadify('uploadify2','缩略图上传','image','image',1,2097152,'picurl')">上 传</span></span>
            </td>
        </tr>
        <tr>
            <td class="td-left">更新时间：</td>
            <td><input class="easyui-datetimebox" name="birthday"
                       data-options="required:true,showSeconds:true" value="<{$row['time']}>" style="width:200px"></td>
        </tr>

    </table>
    <div id="add_ft" style="padding:5px; text-align:center;">
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" onclick="submitForm()">提交</a>
    </div>
</form>
</div>
<script type="text/javascript" src="__JS__/getuploadify.js"></script>
<script type="text/javascript">
    //全局变量
    var GV = {
        ROOT: "__ROOT__/",
        WEB_ROOT: "__WEB_ROOT__/",
        MODULE:"__MODULE__",
        APP:'<{$Think.CONTROLLER_NAME }>'/*当前应用名*/
    };

    $(function(){
        <if condition="!empty($id)">
            $('#form').form('load','<{:U("Info/getInfoDetail")}>/id/<{$id}>');
        </if>

        });



    function submitForm(){
        $('#form').form('submit', {
            url: '<{:U("Info/doAddInfo")}>/id/<{$id}>',
            onSubmit: function () {
                return $(this).form('validate');
            },
            success: function (result) {
                var result = eval('(' + result + ')');
                console.log(result);
                if (result.success) {
                    <if condition="empty($id)">
                        $.messager.confirm('提示', '添加成功，继续添加?', function(r){
                        if (r){
                        $('#form').form('clear');
                        $("#picarr_area").empty();
                    }else{
                        goBack();
                    }
                    });
                        <else />
                        $.messager.alert('提示','修改成功!','info',function(){
                        goBack()
                    });
                    </if>
                } else {
                    $.messager.show({
                        title: '错误提示',
                        msg: result.msg
                    });
                }
            }
        });
    }



</script>


</body>
</html>
